package io.gbznt.modules.buss.constatnt;

/**
 * 农田状态；
 */
public enum ProcessStateEnum {
	/**
	 * 待处理
	 */
	PENDING(0, "待处理"),
	/**
	 * 处理中
	 */
	PROCESSING(1, "进行中"),
	/**
	 * 已完成
	 */
	FINISH(2, "已完成");

	private final int value;

	private final String description;

	private ProcessStateEnum(int value, String description) {
		this.value = value;
		this.description = description;
	}

	public int getValue() {
		return value;
	}

	public String getDescription() {
		return description;
	}

	public static ProcessStateEnum getByValue(Integer value) {
		if (null == value) {
            return null;
        }
		for (ProcessStateEnum enumObj : ProcessStateEnum.values()) {
			if (value.equals(enumObj.getValue())) {
                return enumObj;
            }
		}
		return null;
	}

	public static ProcessStateEnum getByDesc(String description) {
		if (null == description) {
            return null;
        }
		for (ProcessStateEnum enumObj : ProcessStateEnum.values()) {
			if (description.equals(enumObj.getDescription())) {
                return enumObj;
            }
		}
		return null;
	}

}